package com.kinyx.framework.reflect;

import java.util.Map;

import org.junit.Assert;

import lombok.Getter;

class KBeanUtils_Tester_copyProperties_SUPER {

	protected void initA(final Map<String, Object> map) {
		map.put("str", "1");
		map.put("b", (byte) 1);
		map.put("s", (short) 1);
		map.put("i", 1);
		map.put("l", 1L);
		map.put("f", 1f);
		map.put("d", 1d);
		map.put("c", (char) 1);
		map.put("flag", true);
	}

	protected void initB(final Map<String, Object> map) {
		map.put("str", String.valueOf("1"));
		map.put("b", String.valueOf((byte) 1));
		map.put("s", String.valueOf((short) 1));
		map.put("i", String.valueOf(1));
		map.put("l", String.valueOf(1L));
		map.put("f", String.valueOf(1f));
		map.put("d", String.valueOf(1d));
		map.put("c", String.valueOf((char) 1));
		map.put("flag", String.valueOf(true));
	}

	protected void checkNull(final Map<String, Object> map) {
		Assert.assertNull(map.get("str"));
		Assert.assertNull(map.get("b"));
		Assert.assertNull(map.get("s"));
		Assert.assertNull(map.get("i"));
		Assert.assertNull(map.get("l"));
		Assert.assertNull(map.get("f"));
		Assert.assertNull(map.get("d"));
		Assert.assertNull(map.get("c"));
		Assert.assertNull(map.get("flag"));
	}

	protected void checkA(final Map<String, Object> map) {
		Assert.assertTrue(map.get("str").equals("1"));
		Assert.assertTrue(map.get("b").equals((byte) 1));
		Assert.assertTrue(map.get("s").equals((short) 1));
		Assert.assertTrue(map.get("i").equals(1));
		Assert.assertTrue(map.get("l").equals(1L));
		Assert.assertTrue(map.get("f").equals(1f));
		Assert.assertTrue(map.get("d").equals(1d));
		Assert.assertTrue(map.get("c").equals((char) 1));
		Assert.assertTrue(map.get("flag").equals(true));
	}

	protected void checkB(final Map<String, Object> map) {
		Assert.assertTrue(map.get("str").equals(String.valueOf("1")));
		Assert.assertTrue(map.get("b").equals(String.valueOf((byte) 1)));
		Assert.assertTrue(map.get("s").equals(String.valueOf((short) 1)));
		Assert.assertTrue(map.get("i").equals(String.valueOf(1)));
		Assert.assertTrue(map.get("l").equals(String.valueOf(1L)));
		Assert.assertTrue(map.get("f").equals(String.valueOf(1f)));
		Assert.assertTrue(map.get("d").equals(String.valueOf(1d)));
		Assert.assertTrue(map.get("c").equals(String.valueOf((char) 1)));
		Assert.assertTrue(map.get("flag").equals(String.valueOf(true)));
	}

	@Getter
	protected static class A {
		private String str;
		private Byte b;
		private Short s;
		private Integer i;
		private Long l;
		private Float f;
		private Double d;
		private Character c;
		private Boolean flag;
	}

	protected void init(final A bean) {
		bean.str = "1";
		bean.b = (byte) 1;
		bean.s = (short) 1;
		bean.i = 1;
		bean.l = 1L;
		bean.f = 1f;
		bean.d = 1d;
		bean.c = (char) 1;
		bean.flag = true;
	}

	protected void checkNull(final A bean) {
		Assert.assertNull(bean.str);
		Assert.assertNull(bean.b);
		Assert.assertNull(bean.s);
		Assert.assertNull(bean.i);
		Assert.assertNull(bean.l);
		Assert.assertNull(bean.f);
		Assert.assertNull(bean.d);
		Assert.assertNull(bean.c);
		Assert.assertNull(bean.flag);
	}

	protected void check(final A bean) {
		Assert.assertTrue(bean.str.equals("1"));
		Assert.assertTrue(bean.b.equals((byte) 1));
		Assert.assertTrue(bean.s.equals((short) 1));
		Assert.assertTrue(bean.i.equals(1));
		Assert.assertTrue(bean.l.equals(1L));
		Assert.assertTrue(bean.f.equals(1f));
		Assert.assertTrue(bean.d.equals(1d));
		Assert.assertTrue(bean.c.equals((char) 1));
		Assert.assertTrue(bean.flag.equals(true));
	}

	@Getter
	protected static class B {
		private String str;
		private String b;
		private String s;
		private String i;
		private String l;
		private String f;
		private String d;
		private String c;
		private String flag;
	}

	protected void init(final B bean) {
		bean.str = String.valueOf("1");
		bean.b = String.valueOf((byte) 1);
		bean.s = String.valueOf((short) 1);
		bean.i = String.valueOf(1);
		bean.l = String.valueOf(1L);
		bean.f = String.valueOf(1f);
		bean.d = String.valueOf(1d);
		bean.c = String.valueOf((char) 1);
		bean.flag = String.valueOf(true);
	}

	protected void checkNull(final B bean) {
		Assert.assertNull(bean.str);
		Assert.assertNull(bean.b);
		Assert.assertNull(bean.s);
		Assert.assertNull(bean.i);
		Assert.assertNull(bean.l);
		Assert.assertNull(bean.f);
		Assert.assertNull(bean.d);
		Assert.assertNull(bean.c);
		Assert.assertNull(bean.flag);
	}

	protected void check(final B bean) {
		Assert.assertTrue(bean.str.equals("1"));
		Assert.assertTrue(bean.b.equals(String.valueOf((byte) 1)));
		Assert.assertTrue(bean.s.equals(String.valueOf((short) 1)));
		Assert.assertTrue(bean.i.equals(String.valueOf(1)));
		Assert.assertTrue(bean.l.equals(String.valueOf(1L)));
		Assert.assertTrue(bean.f.equals(String.valueOf(1f)));
		Assert.assertTrue(bean.d.equals(String.valueOf(1d)));
		Assert.assertTrue(bean.c.equals(String.valueOf((char) 1)));
		Assert.assertTrue(bean.flag.equals(String.valueOf(true)));
	}

}
